import { AsyncStorage } from 'react-native';

async function set(key, val) {
  try {
   await AsyncStorage.setItem(key, val)
  } catch (err) {
    console.log(err);
  };
}

async function get(key) {
  try {
    const val = await AsyncStorage.getItem(key);
    if (val !== null) {
      return val;
    }
  } catch(err) {
    console.log(err);
  };
}

const store = {
  set,
  get,
}

export default store;
